package com.springcloud.register_user.controller;

import com.springcloud.register_user.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;


@RestController
public class UserController {

    @GetMapping("/user/{username}")
    public User getUser(@PathVariable("username") String username){
        System.out.println("访问register1");
        User user=new User();
        user.setId(111);
        user.setUsername("aaa");
        user.setPassword("aaa");
        if(username.equals(user.getUsername())){
            return user;
        }
        return new User();
    }
}
